package com.cwvs.cat.adapter;

import java.util.List;

import com.cwvs.cat.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class SchoolAdapter extends BaseAdapter {

	private LayoutInflater mInflater = null;
	private ViewHolder holder = null;
	private List<String> mList;

	public SchoolAdapter(Context context, List<String> list){
		this.mInflater = LayoutInflater.from(context);
		mList = list;
		
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mList.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return mList.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		
		if (convertView == null) {
			convertView = mInflater.inflate(R.layout.item_list_my_school, null);
			holder = new ViewHolder();
			holder.school1 = (TextView) convertView.findViewById(R.id.school_1);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}

		return convertView;
	}
	
	static class ViewHolder{
        public TextView school1, school2;

    }

}
